#ifndef unigame_XmlNode_h
#define unigame_XmlNode_h

#include <vector>
#include "config/Def.h"

namespace unixml
{
    class XmlTab;
    class XmlNode
    {
    public:
        XmlNode(uint16* code, int start);
        ~XmlNode();
        
        int getEnd()
        {
            return m_end;
        }
        
        bool isNode()
        {
            return m_isNode;
        }
        
        uint16* getName();
        
        uint16* getAttribute(const uint16* name);
        
    private:
        void init();
		void checkNode();
        
    private:
        uint16* m_content;
        int32 m_start;
        int32 m_end;
        
        bool m_isNode;
        
        uint16* m_code;
        std::vector<XmlNode*> m_children;
        XmlTab* m_tab;
    };
}

#endif /* defined(__unigame__XmlNode__) */
